<?php
/**
* @file Role.php
* Copyright (c) Friends Group. All rights reserved.
* $Id$
*
*/

require_once(realpath(dirname(__FILE__)) . '/../classes/BaseObject.php');

class Role extends BaseObject 
{

    /**
     * @AttributeType int
     */
    protected $ID;

    /**
     * @AttributeType String
     * Các loại quyền, như: Admin, Manager, User....
     */
    protected $roleName;

    public function __construct($roleName = "User")
    {
        switch ($roleName) {
                	case  "User":
                		$this->roleName =$roleName;
                        $this->ID = 3;
                		break;
                    case "Administrator":
                        $this->roleName=$roleName;
                        $this->ID= 1;
                        break;
                    case "Manager":
                        $this->roleName=$roleName;
                        $this->ID=2;
                        break;
                	default:
                		throw new Exception("Không tồn tại role này");
                }
    }
    
    /**
     * @ParamType iD int
     */
    public function setID($ID) 
    {
        $this->ID = $ID;
    }

    /**
     * @ReturnType int
     */
    public function getID() 
    {
        return $this->ID;
    }

    /**
     * @ParamType roleName String
     */
    public function setRoleName($roleName) 
    {
        $this->roleName = $roleName;
    }

    /**
     * @ReturnType String
     */
    public function getRoleName() 
    {
        return $this->roleName;
    }
}
?>